Skip to content

escape database underscore wildcard #500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2020
Merged

escape database underscore wildcard #500

merged 1 commit into from
May 19, 2020

Conversation

Istador
Copy link
Contributor

@Istador Istador commented Oct 4, 2018

if the $MYSQL_DATABASE environment variable contains underscores ("_")
they are now escaped, so that the GRANT matches exactly the given
database name.

@Istador
Copy link
Contributor Author

Istador commented Apr 23, 2020

I force pushed a new version, that is no longer in conflict with the changes made to master since I created this PR.

if the $MYSQL_DATABASE environment variable contains underscores ("_")
they are now escaped, so that the GRANT matches exactly the given
database name.
@tianon
Copy link
Member

tianon commented May 19, 2020

Sorry for the huge delay 😬

I've updated this to include a change to the templated version of this same script.

For posterity, here's the relevant MySQL documentation: (https://dev.mysql.com/doc/refman/8.0/en/grant.html#grant-quoting)

The _ and % wildcards are permitted when specifying database names in GRANT statements that grant privileges at the database level (GRANT ... ON db_name.*). This means, for example, that to use a _ character as part of a database name, specify it as \_ in the GRANT statement, to prevent the user from being able to access additional databases matching the wildcard pattern (for example, GRANT ... ON foo_bar.* TO ...).

@tianon tianon merged commit bc6e37a into docker-library:master May 19, 2020
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request May 20, 2020
Changes:

- docker-library/mysql@bc6e37a: Merge pull request docker-library/mysql#500 from Istador/escape_database_wildcard
- docker-library/mysql@7a87af0: Escape database underscore wildcard
- docker-library/mysql@a769034: Merge pull request docker-library/mysql#667 from docker-library/github-actions
- docker-library/mysql@ab66888: Add initial GitHub Actions CI
yosifkit added a commit to infosiftr/mariadb that referenced this pull request May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants